package lab02.test17;

public class Array {
    public static void main(String[] args) {
        int[] a = new int[]{12, 55, 64, 95, 88, 32, 77, 46, 68, 10};
        int sum = 0;
        int max=0;
        int min = 88;
        int ordermax=0;
        int ordermin = 0;
        for (int i = 0; i <a.length; i++) {
           if(a[i]>max){
               max=a[i];
               ordermax=i;
           }
        }
        for (int i = 0; i <a.length; i++) {
            if(a[i]<min){
                min=a[i];
                ordermin=i;
            }
        }
            for (int i=0;i<a.length;i++) {
                sum = a[i] + sum;
            }
                System.out.println("最大值" + max+ "  最小值" + min+   "  和为：" + sum);
                System.out.println("最大值位置"+ordermax+"   最小值位置"+ordermin);
    }
}
